import pytest

def assert_status_code(actual, expected, message="", response_body=""):
    if actual != expected:
        # pytest.fail(f"{message} 接口,期望接口状态码: {expected}, 实际接口状态码: {actual}, 响应内容: {response_body}", pytrace=False)
        pytest.fail(f"{message} 接口,期望接口状态码: {expected}, 实际接口状态码: {actual} ", pytrace=False)
    # else:
    #     print(f"{message} 接口,期望接口状态码: {expected}, 实际接口状态码: {actual}, 响应内容1: {response_body}")

def assert_body_code(actual, expected, message="", response_body=""):
    if actual != expected:
        # pytest.fail(f"{message} 接口,期望响应状态码: {expected}, 实际响应状态码: {actual}, 响应内容: {response_body}", pytrace=False)
        pytest.fail(f"{message} 接口,期望响应状态码: {expected}, 实际响应状态码: {actual}", pytrace=False)
    # else:
    #     print(f"{message} 接口,期望响应状态码: {expected}, 实际响应状态码: {actual}, 响应内容: {response_body}")

def assert_response_contains(actual, expected, message="", response_body=""):
    if expected == "null":
        expected = None
    if actual != expected:
        # pytest.fail(f"{message} 期望结果: {expected}, 实际结果: {actual}, 响应内容: {response_body}", pytrace=False)
        pytest.fail(f"{message} 期望结果: {expected}, 实际结果: {actual}", pytrace=False)
    # else:
    #     print(f"{message} 期望结果: {expected}, 实际结果: {actual}, 响应内容: {response_body}")